home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacFormat 1995 January
/
macformat-020.iso
/
Shareware City
/
Developers
/
Think C dcmd 1.0.1 ƒ
/
Think Put Lib source
/
__HexToText.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1994-06-12
|
247 b
|
13 lines
|
[
TEXT/KAHL
]
void __HexToText (unsigned long hex, char* str, short size /* 0=word, 1=long */ )
{
int n, len;
char* digits = "0123456789ABCDEF";
len = size ? 8-1 : 4-1;
for ( n = len; n >= 0; n-- )
{
str[n] = digits[hex % 16];
hex /= 16;
}
}